home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / ENET.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  4KB  |  149 lines

  1. /*
  2.      File:        ENET.h
  3.  
  4.      Contains:    Ethernet Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __ENET__
  19. #define __ENET__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32. #if PRAGMA_IMPORT_SUPPORTED
  33. #pragma import on
  34. #endif
  35.  
  36. #if PRAGMA_ALIGN_SUPPORTED
  37. #pragma options align=mac68k
  38. #endif
  39.  
  40. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  41.  
  42. enum {
  43.     ENetSetGeneral                = 253,                            /*Set "general" mode*/
  44.     ENetGetInfo                    = 252,                            /*Get info*/
  45.     ENetRdCancel                = 251,                            /*Cancel read*/
  46.     ENetRead                    = 250,                            /*Read*/
  47.     ENetWrite                    = 249,                            /*Write*/
  48.     ENetDetachPH                = 248,                            /*Detach protocol handler*/
  49.     ENetAttachPH                = 247,                            /*Attach protocol handler*/
  50.     ENetAddMulti                = 246,                            /*Add a multicast address*/
  51.     ENetDelMulti                = 245,                            /*Delete a multicast address*/
  52.     EAddrRType                    = 'eadr'                        /*Alternate address resource type*/
  53. };
  54.  
  55. typedef struct EParamBlock EParamBlock;
  56. typedef EParamBlock *EParamBlkPtr;
  57. /*
  58.         This ProcPtr uses register based parameters on the 68k and cannot
  59.         be written in or called from a high-level language without the help of
  60.         mixed mode or assembly glue.
  61.  
  62.             typedef pascal void (*ENETCompletionProcPtr)(EParamBlkPtr thePBPtr);
  63.  
  64. */
  65.  
  66. #if GENERATINGCFM
  67. typedef UniversalProcPtr ENETCompletionUPP;
  68. #else
  69. typedef Register68kProcPtr ENETCompletionUPP;
  70. #endif
  71. struct EParamBlock {
  72.     QElem *                            qLink;                        /*General EParams*/
  73.     short                             qType;                        /*queue type*/
  74.     short                             ioTrap;                        /*routine trap*/
  75.     Ptr                             ioCmdAddr;                    /*routine address*/
  76.     ENETCompletionUPP                 ioCompletion;                /*completion routine*/
  77.     OSErr                             ioResult;                    /*result code*/
  78.     StringPtr                         ioNamePtr;                    /*->filename*/
  79.     short                             ioVRefNum;                    /*volume reference or drive number*/
  80.     short                             ioRefNum;                    /*driver reference number*/
  81.     short                             csCode;                        /*Call command code*/
  82.     union {
  83.         struct {
  84.             short                             eProtType;            /*Ethernet protocol type*/
  85.             Ptr                             ePointer;            /*No support for PowerPC code*/
  86.             short                             eBuffSize;            /*buffer size*/
  87.             short                             eDataSize;            /*number of bytes read*/
  88.         }                                 EParms1;
  89.         struct {
  90.             Byte                             eMultiAddr[6];        /*Multicast Address*/
  91.         }                                 EParms2;
  92.     }                                 u;
  93. };
  94.  
  95.  
  96. enum {
  97.     uppENETCompletionProcInfo = kRegisterBased
  98.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(EParamBlkPtr)))
  99. };
  100.  
  101. #if GENERATINGCFM
  102. #define CallENETCompletionProc(userRoutine, thePBPtr)        \
  103.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppENETCompletionProcInfo, (thePBPtr))
  104. #else
  105. /* (*ENETCompletionUPP) cannot be called from a high-level language without the Mixed Mode Manager */
  106. #endif
  107.  
  108. #if GENERATINGCFM
  109. #define NewENETCompletionProc(userRoutine)        \
  110.         (ENETCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppENETCompletionProcInfo, GetCurrentArchitecture())
  111. #else
  112. #define NewENETCompletionProc(userRoutine)        \
  113.         ((ENETCompletionUPP) (userRoutine))
  114. #endif
  115. extern pascal OSErr EWrite(EParamBlkPtr thePBptr, Boolean async);
  116.  
  117. extern pascal OSErr EAttachPH(EParamBlkPtr thePBptr, Boolean async);
  118.  
  119. extern pascal OSErr EDetachPH(EParamBlkPtr thePBptr, Boolean async);
  120.  
  121. extern pascal OSErr ERead(EParamBlkPtr thePBptr, Boolean async);
  122.  
  123. extern pascal OSErr ERdCancel(EParamBlkPtr thePBptr, Boolean async);
  124.  
  125. extern pascal OSErr EGetInfo(EParamBlkPtr thePBptr, Boolean async);
  126.  
  127. extern pascal OSErr ESetGeneral(EParamBlkPtr thePBptr, Boolean async);
  128.  
  129. extern pascal OSErr EAddMulti(EParamBlkPtr thePBptr, Boolean async);
  130.  
  131. extern pascal OSErr EDelMulti(EParamBlkPtr thePBptr, Boolean async);
  132.  
  133. #endif
  134.  
  135. #if PRAGMA_ALIGN_SUPPORTED
  136. #pragma options align=reset
  137. #endif
  138.  
  139. #if PRAGMA_IMPORT_SUPPORTED
  140. #pragma import off
  141. #endif
  142.  
  143. #ifdef __cplusplus
  144. }
  145. #endif
  146.  
  147. #endif /* __ENET__ */
  148.  
  149.